package com.maint.m

import android.content.Context
import android.util.Log
import android.widget.Toast
import com.maint.m.utils.BuildConfig

object StreamUtils {
    const val DEFAULT_RTMP_URL = BuildConfig.DEFAULT_RTMP_URL

    fun showStreamMessage(context: Context, message: String) {
        Toast.makeText(context, message, Toast.LENGTH_SHORT).show()
    }

    fun formatStreamError(error: String): String {
        Log.e("StreamManager", "推流错误: $error")
        return "推流错误: $error"
    }

    fun isNetworkUrl(url: String): Boolean {
        return url.startsWith("rtmp://") || url.startsWith("rtsp://")
    }
}
